package com.carepad.action.menuitems;

import java.util.List;

import com.carepad.entity.RecordItemsGroup;
import com.carepad.entity.mapper.SelectClient;

public class RecordItemsGroupViewAction extends AbstractRecordItemsGroupAction{

	private static final long serialVersionUID = 1L;

	private List<RecordItemsGroup> menuItemList;

	private String patientClientUID;

	public String execute() {
		try {
			
			if(patientClientUID != null)
			{
				SelectClient  patient = getPatientByUid(patientClientUID);			
				addSessionVariable(patient);
				setCookie("CLIENTUID",patientClientUID);
			}
		
			menuItemList = recordItemsGroupService.findRecordItemsGroupList();
			
			
				
		} catch (Exception e) {
			e.printStackTrace();
			addActionError(getText("global.error.page"));
		}
		return SUCCESS;
	}
	
	public List<RecordItemsGroup> getMenuItemList() {
		return menuItemList;
	}

	public void setMenuItemList(List<RecordItemsGroup> menuItemList) {
		this.menuItemList = menuItemList;
	}

	public String getPatientClientUID() {
		return patientClientUID;
	}

	public void setPatientClientUID(String patientClientUID) {
		this.patientClientUID = patientClientUID;
	}

}
